package com.hnas.activity.domain;

import java.util.HashMap;
import java.util.Map;

import com.hnas.core.util.StringUtil;

public enum ActivityType {

	CGDZ("11","1","常规打折活动","补贴活动"),
	MJ1("12","1","满减活动1","补贴活动"),
	SJJ("13","1","随机减活动","补贴活动"),
	HYCX("21","2","会员日促销活动","会员活动");
	
	private String type;
	private String ptype;
	private String des;
	private String pdes;
	
	private static Map<String,ActivityType> map = new HashMap<String,ActivityType>();
	
	static{
		for(ActivityType t : ActivityType.values()){
			map.put(t.type, t);
		}
	}
	
	private ActivityType(String type, String ptype, String des, String pdes) {
		this.type = type;
		this.ptype = ptype;
		this.des = des;
		this.pdes = pdes;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getPtype() {
		return ptype;
	}
	public void setPtype(String ptype) {
		this.ptype = ptype;
	}
	public String getDes() {
		return des;
	}
	public void setDes(String des) {
		this.des = des;
	}
	public String getPdes() {
		return pdes;
	}
	public void setPdes(String pdes) {
		this.pdes = pdes;
	}
	
	
	public static ActivityType getByType(String type){
		if(StringUtil.isEmpty(type)) return null;
		if(map.containsKey(type)) return map.get(type);
		return null;
	}
}
